package com.juc;



public class AtomicIntegerPart1 {

	/*@Test
	public void testAll() throws InterruptedException {
		final AtomicInteger value = new AtomicInteger(10);
		System.out.println(value.addAndGet(1));

		assertEquals(value.compareAndSet(11, 2), true);
		assertEquals(value.get(), 2);
		assertEquals(value.getAndAdd(2), 2);
		assertEquals(value.getAndAdd(2), 4);
		assertEquals(value.get(), 6);

		final int threadSize = 10;

		Thread[] ts = new Thread[threadSize];
		for (int i = 0; i < ts.length; i++) {
			ts[i] = new Thread() {
				public void run() {
					value.incrementAndGet();
				}
			};
		}

		for (Thread t : ts) {
			t.start();
		}
		for (Thread t : ts) {
			t.join();
		}
		assertEquals(value.get(), 16);
	}*/

}
